﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy.Core.Common;
using FortuneHeavenCommon.DataMap;
using FortuneHeavenDAL;

namespace FortuneHeavenBAL
{
    public class UserInforBO : CommonOperate<UserInfor>
    {
        public UserInforDAL _userDAL;
        public UserInforBO()
            : base()
        {
            _userDAL = new UserInforDAL();
        }

        public UserInfor GetUserInfor(int userid)
        {
            return _userDAL.GetUserInfor(userid);
        }

        public void SaveUserInfor(UserInfor infor)
        {
            if (infor.ID <= 0)
            {
                infor.ID = this.GetMaxID();
                Save(infor, true);
            }
            else
            {
                Save(infor);
            }
        }

        public List<UserInfor> GetTopSpreadValue(int top)
        {
            return _userDAL.GetTopSpreadValue(top);
        }

        public List<UserInfor> GetSpecialRegisterList(int page, int size, string username,string frompage)
        {
            if (frompage == "全部")
            {
                frompage = "";   
            }
            return _userDAL.GetSpecialRegisterList(page, size, username, frompage);
        }

        public int GetSpecialRegisterTotalSize(string username, string frompage)
        {
            if (frompage == "全部")
            {
                frompage = "";
            }
            return _userDAL.GetSpecialRegisterTotalSize(username, frompage);
        }

    }
}
